package com.turing.system.controller;

import com.alibaba.fastjson.JSONObject;
import com.turing.system.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import result.Result;

import java.text.ParseException;

@RestController
public class MessageController {
    @Autowired
    private MessageService messageService;

    @PostMapping("/message/addSave")
    public Result addSave(@RequestBody JSONObject jsonObject) throws ParseException {
        return messageService.addSave(jsonObject);
    }

    @PatchMapping("/message/msgEdit")
    public Result msgEdit(@RequestBody JSONObject jsonObject) throws ParseException {
        return messageService.msgEdit(jsonObject);
    }
}
